package com.knowif.dao;

import com.knowif.pojo.TutorInfo;
import com.knowif.pojo.TutorInfoExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface TutorInfoMapper {
    int countByExample(TutorInfoExample example);

    int deleteByExample(TutorInfoExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(TutorInfo record);

    int insertSelective(TutorInfo record);

    List<TutorInfo> selectByExample(TutorInfoExample example);

    TutorInfo selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") TutorInfo record, @Param("example") TutorInfoExample example);

    int updateByExample(@Param("record") TutorInfo record, @Param("example") TutorInfoExample example);

    int updateByPrimaryKeySelective(TutorInfo record);

    int updateByPrimaryKey(TutorInfo record);

    /**
     * @author: xingyao 
     * @Description:  更新导师被收藏数
     * @param userId
     * @return
     */
    int updateCollectNumByUserId(Integer userId);

    /**
     * @author: xingyao 
     * @Description:  批量更新导师被收藏数
     * @param userIds
     * @return
     */
    int updateCollectNumByUserIds(List<Integer> userIds);

    /**
     * 导师筛选
     * @param params
     * @return
     */
    List<TutorInfo> screen(Map<String, Object> params);

    /**
     * 导师帮助人 +1
     * @param userId
     * */
    void addHelpsNumByUserId(Integer userId);
    /**
     * 合计金额
     * @param userId
     * @param totalIncome 订单金额
     * */
    void addTotalIncomeByUserId(@Param("userId") Integer userId,@Param("totalIncome") Double totalIncome);

    /**
     * 后台导师筛选
     * @param params
     * @return
     */
    List<TutorInfo> backendScreen(Map<String, Object> params);

}